package com.blindBox.front.Timer;

import com.blindBox.front.service.UserService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import java.util.Date;

//定时清零所有用户投掷盲盒数量的定时器
public class ClearUserStatusJob extends QuartzJobBean
{
    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException
    {
        System.out.println("==============================");
        System.out.println("定时器执行中,当前时间:  "+new Date());
        System.out.println("================================");
        UserService userService = (UserService)jobExecutionContext.getJobDetail().getJobDataMap().get("userService");
        userService.clear_all_user_status();
    }
}
